package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IWorkerCertAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController("workCertAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api("服务人员实名认证")
public class WorkerCertAuditController {
    @Resource
    private IWorkerCertAuditService workCertAuditService;

    @PostMapping
    @ApiOperation("服务人员实名认证接口")
    public void workerAuthentication(
            @RequestBody @ApiParam(name = "dto", value = "实名信息")
            WorkerCertificationAuditAddReqDTO dto,
            HttpServletRequest request
    ) {
        workCertAuditService.WorkeRealNameAuthentication(dto, request);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询当前服务人员用户实名认证的驳回原因接口")
    public Map<String, String> currentWorkerRejectReason(HttpServletRequest request) {
        return workCertAuditService.rejectReason(request);
    }
}
